package com.jiazhong.Dao;

import com.jiazhong.pojo.Student;
import org.apache.ibatis.annotations.*;

import java.util.List;

public interface StudentDao {
    @Select("select * from student")
    List<Student> findAll();
    @Insert("insert into student values(null,#{name},#{sex},#{age},#{major},#{time})")
    void saveStudent(Student student);
    @Delete("delete from student where id=#{id}")
    void deleteStudent(int id);
    @Update("update student set name=#{name},sex=#{sex},age=#{age},major=#{major},time=#{time}where id=#{id}")
    void updateStudent(Student student);
    @Select("select * from student where id=#{id}")
    Student selectById(int id);
    @Select("select * from student where name like '%${value}%'")
    List<Student> selectByName(String name);
    @Select("select  count(*) from student")
    int selectTotal();
//    @Select("select * from user where sname=#{sname} and password=#{password}")
//    User login(@Param("sname") String sname,@Param("password") String password);
}
